package ro.bluecube.admlocal.main;


import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Collection;

import javax.swing.JMenuItem;

public class Main {
	public static final MainFrame mainFrame = MainFrame.getInstance();
	public static void main(String[] args) {
		mainFrame.setMenuItems(getMenuItems());
	}

	private static Collection getMenuItems() {
		Collection buttons = new ArrayList();
		JMenuItem but = new JMenuItem("Administrare");
		but.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				ActionEvent event = new ActionEvent(mainFrame,
						MainFrame.ADMINISTRARE_ACTION, "Administrare Controller");
				handleEvent(event);
			}
		});
		buttons.add(but);
//		but = new JMenuItem("Arbitri");
//		but.addActionListener(new ActionListener() {
//			public void actionPerformed(ActionEvent e) {
//				ActionEvent event = new ActionEvent(mainFrame,
//						MainFrame.ARBITRI_ACTION, "Arbitri Controller");
//				handleEvent(event);
//			}
//		});
//		buttons.add(but);
//		but = new JMenuItem("Meciuri");
//		but.addActionListener(new ActionListener() {
//			public void actionPerformed(ActionEvent e) {
//				ActionEvent event = new ActionEvent(mainFrame,
//						MainFrame.MECIURI_ACTION, "Meciuri Controller");
//				handleEvent(event);
//			}
//		});
//		buttons.add(but);
//		but = new JMenuItem("Sponsori");
//		but.addActionListener(new ActionListener() {
//			public void actionPerformed(ActionEvent e) {
//				ActionEvent event = new ActionEvent(mainFrame,
//						MainFrame.SPONSORI_ACTION, "Sponsori Controller");
//				handleEvent(event);
//			}
//		});
//		buttons.add(but);
//		but = new JMenuItem("Rapoarte");
//		but.addActionListener(new ActionListener() {
//			public void actionPerformed(ActionEvent e) {
//				ActionEvent event = new ActionEvent(mainFrame,
//						MainFrame.RAPOARTE_ACTION, "Rapoarte Controller");
//				handleEvent(event);
//			}
//		});
		buttons.add(but);
		return buttons;
	}

	public static void handleEvent(ActionEvent e){
		MainFrame.getInstance().procesEvent(e);
	}
	
}
